Like draw_sprite_scaled, with the picture leaned as well: xshear slides its top sideways and yshear lifts one side, the same numbers the xshear and yshear instance variables take.
Works differently on Game Boy - A turned, resized or leaned sprite shows the nearest look the build draws ahead of time: turns in steps (Project Settings: Sprite turn steps), a few sizes and leans, and a negative size mirrors exactly. The looks share the 384 tiles of video memory, so there is room for few.
Works differently on Game Boy Color - The Game Boy Color cannot turn, resize or lean a sprite, so the build draws those looks ahead of time and shows the nearest one: turns come in steps (Project Settings: Sprite turn steps), sizes and leans in a few steps. Each look takes memory.
Sega Genesis: not available
On other consoles this differs: see Side by side and How the consoles differ.
draw_sprite_sheared(spr, x, y, frame, angle, xscale, yscale, xshear, yshear, flip_x, flip_y, depth)| Name | Type |
|---|---|
spr | sprite |
x | real |
y | real |
frame | int |
angle | real |
xscale | real |
yscale | real |
xshear | real |
yshear | real |
flip_x | bool |
flip_y | bool |
depth | real |
Nothing.
Everything draw_sprite_scaled does, plus a lean: xshear slides the top of the picture sideways and yshear lifts one side. They are the same two numbers the xshear and yshear instance variables take, and mean the same thing - pixels sideways for every pixel of height, and pixels up for every pixel of width.
Use it for a picture that leans differently from the object that draws it: a shadow lying along the ground, a reflection, or a copy of the sprite that wobbles on its own. To lean the object's own picture, set xshear instead; default drawing and draw_self will do the rest.


Left: a lighthouse and its shadow, which is a flat dark copy of the lighthouse drawn with the page's first example (half as tall, leaned left, one depth band behind). Right: the second example, a lean to the right at normal size. A lighthouse stands in for the example's glow sprite so the shapes are easy to read. Real pictures from a Game Boy Advance ROM.


The shadow's xshear going -0.80, -0.74 ... 0 ... 0.80 and back (the number under the shadow is the one in use), with the shadow slid sideways as it leans so its foot stays on the lighthouse's foot - the way a shadow swings as the sun moves. The lighthouse and the one on the right do not change. Sixteen real pictures, two frames apart, played at half the speed of the console. A viewer that does not animate shows the first frame.
x and y are a place in the room, counted from the room's top-left corner, exactly as in draw_sprite. The sprite is drawn with its origin on that spot, and the lean pivots on it, so a sprite whose origin is at its feet leans with its feet planted.
The picture is cached the same way as every other draw_ call: call it every frame it should stay on screen.
draw_sprite_sheared(spr_doc_glow, x + 6, y + 10, 0, 0, 1, 0.5, -0.8, 0, false, false, depth + 16);A shadow of the glow: half as tall, leaned left, a little to the side and below, one depth band behind the object.
draw_sprite_sheared(spr_doc_glow, x, y, 0, 0, 1, 1, 0.5, 0, false, false, depth);The glow leaning right, at normal size and not turned.
Like any picture that is turned, scaled or leaned, it takes one of the console's 32 hardware matrices while it is on screen - see Budgets. With a lean of 0, no turn and a scale of 1 it takes none, exactly like draw_sprite.
The lean is exact while angle is 0; with a turn as well, the picture is still leaned, but not in line with the screen's rows and columns. The hardware draws a leaned sprite into a box no bigger than twice its own size, so a lean past 1 on a square sprite starts to cut off its corners.
Unlike the xshear and yshear instance variables, this call costs an object nothing extra to own: nothing is added to any instance.